package com.proxy.cglib;
//cglib代理类
//基于父类实现
//代理类与目标类继承相同的父类
public class CglibProxy extends Target{
    private Target target;
    //传入代理的目标类
    public CglibProxy(Target target) {
        this.target = target;
    }

    @Override
    public void method() {
        before();
        target.method();
        System.out.println("执行后");
    }

    public void before(){
        System.out.println("执行前");
    }

}
